home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / D-G / Dorothy'sPascalApp.cpt / Muscle.Pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-04-20  |  5.1 KB  |  196 lines  |  [TEXT/TPAS]

  1. program Muscle;{draws all three muscle fiber/myofilaments on screen at once}
  2.     {U$-}
  3.     uses {statement to use Mac ToolBox routines}
  4.         MemTypes,QuickDraw,OSIntF,ToolIntf;
  5.    
  6.  var {global variables --- some could be put in procedural variables altho}
  7.       {procedures use most of these variables}
  8.   ArcRect : rect;{could have declared this as Arc --- will do later}
  9.   OvalRect : rect;{could have declared this as Oval --- will do later}
  10.   NumbA : integer;{didn't use this but put it in for future}
  11.   Angle:integer;
  12.   Arc : rect;
  13.   Oval : rect;
  14.   Count : integer;
  15.   myPort:GrafPort;
  16.   r:Rect;
  17.  
  18.  
  19. Procedure RelaxedMuscle;
  20.  
  21.   begin
  22.  PenSize (3,3);      
  23.  MoveTo(85, 24);{move cursor to these coordinates}
  24.  LineTo(350,24);{draw line from 70H to 390H}
  25.  MoveTo(85, 104);{move cursor to these coordinates V 200}
  26.  LineTo(355,104);{draw line from 70H to 390H and 200V}
  27.  
  28.  {--------------------------------}
  29.  
  30.  SetRect(ArcRect,305,25,405,105);{set oval for black arc of A band}
  31.  SetRect(OvalRect,270,27,370,104);{set oval for white blocking of A band}
  32.  PaintOval(ArcRect);{paint black part of A band}
  33.  PenPat(White);{set pen to white}
  34.  PaintOval(OvalRect);{paint blocking white part of A band}
  35.  
  36.  for count := 1 to 2 do {draw A bands}
  37.       begin
  38.           OffSetRect(ArcRect, -90,0);{move rectangle to left by 90}
  39.           OffSetRect(OvalRect, -90,0);
  40.           PenPat (Black);
  41.           PaintOval(ArcRect);
  42.           PenPat (White);
  43.           PaintOval(OvalRect);
  44.       end;
  45.       
  46.         PenPat(black); {Set Z lines}
  47.         PenSize(2,2);
  48.         SetRect(Arc,60,25,160,105);
  49.         FrameArc(Arc,0,180);
  50.             for count := 1 to 2 do
  51.                 begin
  52.                 OffSetRect(Arc, 95,0);
  53.                 FrameArc(Arc,0,180);
  54.                end;
  55.       
  56.  PenPat(Dkgray);
  57.  SetRect(OvalRect, 35,25,135,105);
  58.  PaintOval(OvalRect);
  59.  
  60.  end; {Procedure RelaxedMuscle}
  61.  
  62. Procedure Myofilaments;
  63.  
  64.     begin
  65.     
  66.         MoveTo(75, 119);{move cursor to these coordinates}
  67.         LineTo(360,119);{draw line from 75H to 360H}
  68.         MoveTo(75, 200);{move cursor to these coordinates V 200}
  69.         LineTo(362,200);{draw line from 75H to 360H and 200V}
  70.  
  71.  
  72.  {Draw Z lines}
  73.  
  74.         PenPat(Black);
  75.         PenSize(2,2);
  76.         SetRect(Arc,90,119,190,200);
  77.         FrameArc(Arc,0,180);
  78.             for count := 1 to 1 do
  79.                 begin
  80.                 OffSetRect(Arc, 160,0);
  81.                 FrameArc(Arc,0,180);
  82.                end;
  83.                
  84.     PenSize(5,5);
  85.     SetRect(Arc,312,119,412,200);
  86.     FrameArc(Arc, 0,180);
  87.   {Draw Thick Filaments} {This might work better if set rectangle to 0}
  88.    {vertical and then use offset rectangle}
  89.     PenSize(3,3);
  90.     MoveTo(190,125);
  91.     LineTo(300,125);
  92.     MoveTo(200,140);
  93.     LineTo(310,140);
  94.     MoveTo(210,155);
  95.     LineTo(320,155);
  96.     MoveTo(200,170);
  97.     LineTo(310,170);
  98.     MoveTo(190,185);
  99.     LineTo(300,185); 
  100.   {Draw Thin Filaments}
  101.     PenSize(1,1);
  102.     MoveTo(100,133);
  103.     LineTo(240,133);
  104.     
  105.     MoveTo(110,148);
  106.     LineTo(250,148);
  107.     
  108.     MoveTo(120,163);
  109.     LIneTo(260,163);
  110.   
  111.     MoveTo(110,178);
  112.     LineTo(250,178);
  113.    
  114.     MoveTo(100,193);
  115.     LineTo(240,193);
  116.   
  117.     MoveTo(270,133);
  118.     LineTo(390,133); 
  119.    
  120.     MoveTo(280,148);
  121.     LineTo(400,148);
  122.   
  123.     MoveTo(290,163);
  124.     LIneTo(410,163);
  125.   
  126.     MoveTo(280,178);
  127.     LineTo(400,178);
  128.    
  129.     MoveTo(270,193);
  130.     LineTo(390,193);        
  131.     PenPat(Dkgray);
  132.     SetRect(Oval, 35,119,135,201);
  133.     PaintOval(Oval);
  134.     
  135.   end; {procedure Myofilaments}
  136.   
  137.   Procedure ContractedMuscle;
  138.   
  139.   begin
  140.     
  141.     PenSize(1,2);
  142.     MoveTo(105, 219);{move cursor to these coordinates}
  143.     LineTo(300,219);{draw line from 70H to 390H}
  144.     MoveTo(105, 300);{move cursor to these coordinates V 200}
  145.     LineTo(300,300);{draw line from 70H to 390H and 200V}
  146.  
  147.     PenPat(black);
  148.     SetRect(ArcRect,250,219,350,302);
  149.     SetRect(OvalRect,215,220,315,300);
  150.     PaintOval(ArcRect);
  151.     PenPat(White);
  152.     PaintOval(OvalRect);
  153.  
  154.         for count := 1 to 2 do
  155.              begin
  156.                 OffSetRect(ArcRect, -65,0);
  157.                 OffSetRect(OvalRect, -65,0);
  158.                 PenPat (Black);
  159.                 PaintOval(ArcRect);
  160.                 PenPat (White);
  161.                 PaintOval(OvalRect);
  162.             end;
  163.             
  164.         PenPat(black); {Set Z lines}
  165.         PenSize(2,2);
  166.         SetRect(Arc,75,220,175,302);
  167.         FrameArc(Arc,0,180);
  168.             for count := 1 to 2 do
  169.                 begin
  170.                 OffSetRect(Arc,65,0);
  171.                 FrameArc(Arc,0,180);
  172.                end;
  173.       
  174.     PenPat(Dkgray);
  175.     SetRect(OvalRect, 60,220,160,301);
  176.     PaintOval(OvalRect);
  177.     
  178.   end; {Procedure ContractedMuscle}
  179.   
  180. begin {main program of Muscle}
  181.  
  182.  InitGraf(@thePort);{initialization for a graph port}
  183.  OpenPort(@myPort);
  184.  FillRect(myPort.portBits.Bounds,white);{fills screen with white}
  185.  PenPat(black);
  186.  PenSize(4,5);
  187.  SetRect(r,2,2,508,338);{coordinates for top left and bottom right of screen}
  188.  FrameRect(r);{Puts black border around screen ---jazz it up a little}
  189.  
  190.  
  191.     RelaxedMuscle;
  192.     Myofilaments;
  193.     ContractedMuscle;
  194.   Repeat 
  195.   until Button;{press mouse button to go back to Finder}
  196. end. {end program Muscle}